<?php
$tbGallery = new Model_DbTable_Gallery();
$listGallery = $tbGallery->getListActive()->query()->fetchAll();

$controller = $this->app_controller;
$action     = $this->app_action;

$h = 455 .'px';
if($controller == 'product' && $action == 'category') {
    $h = 250 .'px';
    $id = $this->category['id'];
    $tbCategoryImage = new Model_DbTable_ProductCategoryImage();
    $listGallery = $tbCategoryImage->fetchAll(array('product_category_id =?' => $id));
    if($listGallery->count()) {
        $listGallery = $listGallery->toArray();
    } else {
        $listGallery = null;
    }
}
?>

<?php if($listGallery): ?>
    <div id="slide" class="nivoSlider" style="width:930px;padding-right:1px;<?= $h ?>">
        <?php foreach($listGallery as $v): ?>
    		<img class="images-slide-show" src="<?php echo $v['path']; ?>" height="<?= $h ?>" title="<?php echo $v['caption']; ?>" alt="<?php echo $v['caption']; ?>"/>
        <?php endforeach; ?>
    </div>
    <script type="text/javascript">
    	$(window).load(function() {
    		$('#slide').nivoSlider();
    	});
    </script>
<?php endif; ?>